{extend name="common/base" /}

{block name="title"}会员列表 - 会员列表{/block}

{block name="content"}
<div class="Hui-admin-article">
    <nav class="breadcrumb" style="background-color:#fff;padding: 0 24px">
        首页
        <span class="c-gray en">/</span>
        会员管理
        <span class="c-gray en">/</span>
        会员列表
    </nav>

    <article class="Hui-admin-content clearfix">

        <div class="panel mt-20">
            <div class="panel-body">
                <form class="row clearfix">
                    <div class="col-xs-12 col-sm-6 col-md-4">
                        <div class="row clearfix mb-10">
                            <span class="col-xs-4 form-item-label">开始日期：</span>
                            <span class="col-xs-8 form-item-control">
                                <input type="text" id="search-datetime-start" name="start" value="{$search.start}" class="input-text datetimepicker-input">
                            </span>
                        </div>
                    </div>
                    <div class="col-xs-12 col-sm-6 col-md-4">
                        <div class="row clearfix mb-10">
                            <span class="col-xs-4 form-item-label">结束日期：</span>
                            <span class="col-xs-8 form-item-control">
                                <input type="text" id="search-datetime-end" name="end" value="{$search.end}" class="input-text datetimepicker-input">
                            </span>
                        </div>
                    </div>
                    <div class="col-xs-12 col-sm-6 col-md-4">
                        <div class="row clearfix mb-10">
                            <span class="col-xs-4 form-item-label">用户电话：</span>
                            <span class="col-xs-8 form-item-control">
                                <input type="text" name="user_name" value="{$search.user_name}" id="search-input" placeholder=" 用户电话" class="input-text" />
                            </span>
                        </div>
                    </div>
                    <div class="col-xs-12 col-sm-6 col-md-4">
                        <div class="row clearfix">
                            <span class="col-xs-4 form-item-control">
                                <button name="" id="search-submit" class="btn btn-success radius" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜用户</button>
                            </span>
                        </div>
                    </div>
                </form>
            </div>
            <div class="panel-body">
                <div class="clearfix">
                    <span class="f-l">
                        <a href="javascript:;" onclick="member_add('添加会员')" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i>添加会员 </a>
                        <a href="javascript:;" onclick="member_del_all()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>

                    </span>
                    <span class="f-r">共有数据：<strong>{$count}</strong> 条</span>
                </div>
                <div class="mt-20 clearfix">
                    <table class="table table-border table-bordered table-bg table-hover table-sort">
                        <thead>
                            <tr>
                                <th scope="col" colspan="13">会员列表</th>
                            </tr>
                            <tr class="text-c">
                                <th width="25"><input type="checkbox" name="all" value=""></th>
                                <th width="40">ID</th>
                                <th width="150">用户电话</th>
                                <th width="150">真实姓名</th>
                                <th width="150">状态</th>
                                <th width="150">注册时间</th>
                                <th width="150">最后登陆时间</th>
                                <th width="100">开通协议</th>
                                <th width="100">开通题库</th>
                                <th width="200">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            {foreach name="list" key="k" item="v"}
                            <tr class="text-c">
                                <td><input name="list_box" type="checkbox" value="{$v.id}" ></td>
                                <td>{$v['id']}</td>
                                <td>{$v.user_name}</td>
                                <td>{$v.nick_name}</td>
                                <td class="td-status">
                                    {if $v.status == 1}
                                    <span class="label label-success radius">已启用</span>
                                    {else /}
                                    <span class="label radius">已冻结</span>
                                    {/if}
                                </td>
                                <td>{$v.created|date="Y-m-d H:i:s"}</td>
                                <td>{$v.last_login_time|date="Y-m-d H:i:s"}</td>
                                <td> <a href="javascript:;" onclick="open_course('开通协议',{$v.id},'1200','800')" class="btn btn-primary radius">开通协议 </a></td>
                                <td> <a href="javascript:;" onclick="open_question('开通题库',{$v.id},'800','600')" class="btn btn-primary radius">开通题库 </a></td>
                                <td class="td-manage">
                                    {if $v.status == 1}
                                    <a href="javascript:;" onclick="member_stop(this,{$v.id})" class="btn btn-danger radius">停用 </a>
                                    {else /}
                                    <a href="javascript:;" onclick="member_start(this,{$v.id})" class="btn btn-danger radius">启用 </a>
                                    {/if}
                                    <a href="javascript:;" onclick="czmm(this,{$v.id})" class="btn btn-danger radius">重置密码 </a>
                                    <a title="编辑" href="javascript:;" onclick="member_edit('编辑',{$v.id},'900','600')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a>
                                    <a title="删除" href="javascript:;" onclick="member_del(this,{$v.id})" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a>
                                </td>
                            </tr>
                            {/foreach}
                            
                        </tbody>
                    </table>
                    
                    {$page|raw}
                </div>
            </div>
        </div>
    </article>
</div>
<input name="set_status" type="hidden" value="{:url('member/set_status')}">
<input name="del" type="hidden" value="{:url('member/del')}">
<input name="edit" type="hidden" value="{:url('member/edit')}">
<input name="add" type="hidden" value="{:url('member/add')}">
<input name="delAll" type="hidden" value="{:url('member/delAll')}">
<input name="detail" type="hidden" value="{:url('member/detail')}">
<input name="openCourse" type="hidden" value="{:url('member/openCourse')}">
<input name="openQuestion" type="hidden" value="{:url('member/openQuestion')}">

{/block}


{block name="js"}
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__LIB__/datatables/1.10.15/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="__LIB__/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="__JS__/main.js"></script>
<script type="text/javascript">
    $(function(){
        runDatetimePicker();
    });

    /*会员-启用*/
    function czmm(obj,id){
        layer.confirm('确认要重置吗？',function(index){
            //此处请求后台程序，下方是成功后的前台处理……
            $.ajax({
                url : "{:url('member/czmm')}",
                type : 'post',
                dataType : 'json',
                data : { id:id, ff:-1 },
                success : function(ret){
                    if(ret.code == 0){

                        layer.msg('已重置!', {icon: 6,time:1000});
                    }else{
                        layer.msg(ret.msg,{icon: 2,time:1000});
                    }
                }
            });

        });
    }
</script>
<!--/请在上方写此页面业务相关的脚本-->
{/block}

